const express = require('express')
const app = express()
const bodyParser = require('body-parser')
const uploadMiddleware = require('./middlewares/upload')

app.use(bodyParser.urlencoded({ extended: false }))

const uploadControl = (req, res, next) => {
  console.log('req.file', req.file);
  res.send('文件上传成功')
}

app.use('/api/files/upload', uploadMiddleware, uploadControl)

app.listen(3000, () => {
  console.log('localhost:3000');
})
